package pathways;

/**
 * Title:        Pathways
 * Description:  Pure Java version of the Pathways Project.
 * Copyright:    Copyright (c) 2002
 * Company:      Ants Technologies
 * @author Veejay Sani
 * @version 1.0
 */
import java.awt.Dimension;
import java.awt.Point;
import java.awt.Rectangle;

class Connector
{
  public Connector(Point topleft, int height, int width)
  {
    this.topleft = topleft;
    this.height = height;
    this.width = width;

    rect = new Rectangle(topleft,new Dimension(width,height));
  }

  public Point getPoint(int pointNum)
  {
    switch(pointNum)
    {
      case 0:
        return topleft;
      case 1:
        return new Point(topleft.x+width/2,topleft.y);
      case 2:
        return new Point(topleft.x+width,topleft.y);
      case 3:
        return new Point(topleft.x+width,topleft.y+height/2);
      case 4:
        return new Point(topleft.x+width,topleft.y+height);
      case 5:
        return new Point(topleft.x+width/2,topleft.y+height);
      case 6:
        return new Point(topleft.x,topleft.y+height);
      case 7:
        return new Point(topleft.x,topleft.y+height/2);
      default:
        return topleft;
      }
  }

  private Point topleft;
  public int height;
  public int width;
  private Rectangle rect;
}
